package com.owdp.code.controller;

import com.owdp.code.entity.Admin;
import com.owdp.code.mapper.AdminMapper;
import com.owdp.code.service.AdminService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping
public class DemoController {
    @Resource
    AdminService adminService;
//测试Controller
//    @GetMapping(value = "/cs")
//    public String login(String anumber, String apassword) {
//        String pwd = adminMapper.findAdminByNumberAndPassword(anumber);
//        System.out.println("pwd:" + pwd);
//        System.out.println("apassword:" + apassword);
//        return anumber + apassword;
//    }
    @PostMapping(value = {"/cs"})
    public void regist(Admin admin){
//        adminService.regist(admin);
        adminService.regist(admin);
    }
}
